import Vue from 'vue';
import VueRouter from 'vue-router';
import Homepage from '@/pages/homepage';
import Play from '@/pages/play';
import Tuijian from '@/pages/homepage/pages/tuijian';
import Rege from '@/pages/homepage/pages/rege';
import Sousuo from '@/pages/homepage/pages/sousuo';

// 注册路由组件
Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    component: Homepage,
    redirect: '/tuijian', // 重定向 全路径
    children: [
      {
        path: 'tuijian',
        component: Tuijian,
      },
      {
        path: 'rege',
        component: Rege,
      },
      {
        path: 'sousuo',
        component: Sousuo,
      },
    ],
  },
  {
    path: '/play',
    component: Play,
  },
];

// 导出路由实例
export default new VueRouter({
  // 挂载路由信息
  routes,
});
